home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
- The purchaser of these procedures and functions may include them in COMPILED
- programs freely, but may not sell or give away the source text.
-
- If your program uses several windows, or if you change the
- window placement often during development, you may want to
- use the following simple procedures. You just define the
- four co-ordinates of each window as a single constant of
- type "corners" at the beginning of your program. Then if
- you want to change that window, you just change it once.
-
- The DoFrame procedure creates a frame AROUND a window. It
- is up to you to make sure that there exists at least one
- space around the window on all sides. You specify the
- character to be used in the across and down lines. If the
- across character is the single or double line (#196 or #205),
- the corners will be the appropriate corner characters--other-
- wise, they will be the same as the across character
-
- }
-
- type
- corners = array[1..4] of byte;
-
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
- procedure DoWindow(the_Win : corners);
- begin
- window(the_Win[1], the_Win[2], the_Win[3], the_Win[4]);
- GotoXY(1,1);
- end;
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
- procedure DoFrame(the_Win : corners ; across, down : char);
- var
- FrameCorners : array[1..4] of char;
- N : byte;
- begin
- window(1,1,80,25);
- case across of
- #196 : begin
- FrameCorners[1] := #218;
- FrameCorners[2] := #191;
- FrameCorners[3] := #192;
- FrameCorners[4] := #217;
- end;
- #205: begin
- FrameCorners[1] := #201;
- FrameCorners[2] := #187;
- FrameCorners[3] := #200;
- FrameCorners[4] := #188;
- end;
- else
- for N := 1 to 4 do
- FrameCorners[N] := across;
- end; {case}
- GotoXY(the_Win[1]-1,the_Win[2]-1); Write(FrameCorners[1]);
- for N := the_Win[1] to the_Win[3] do Write(across);
- Write(FrameCorners[2]);
- for N := the_Win[2] to the_Win[4] do
- begin
- GotoXY(the_Win[3]+1,N);
- write(down);
- end;
- GotoXY(the_Win[3]+1, the_Win[4]+1); Write(FrameCorners[4]);
- for N := the_Win[3] downto the_Win[1] do
- begin
- GotoXY(N,the_Win[4]+1);
- write(across);
- end;
- GotoXY(the_Win[1]-1, the_Win[4]+1); Write(FrameCorners[3]);
- for N := the_Win[4] downto the_Win[2] do
- begin
- GotoXY(the_Win[1]-1,N);
- Write(down);
- end;
- end;
- {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}